﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

namespace OpalisConsole.Views
{
    public partial class UserImaging : Page
    {
        public UserImaging()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (App.Current.Resources["Computer_ID"].Equals("Not Approved"))
            {
                this.NavigationService.Navigate(new System.Uri("/User_Imaging/Registration", System.UriKind.Relative));
            }
            else
            {
                if (App.Current.Resources.Contains("DeveloperStatus"))
                {
                    if ((bool)App.Current.Resources["DeveloperStatus"]) { LinkUseUSMT.Visibility = System.Windows.Visibility.Visible; }
                }
                SetupMessage();
            }
        }

        protected void SetupMessage()
        {
            txtLandingHeader.Text = "Welcome to the General Mills Information Systems Fresh Start Process!";
            txtLandingContent.Text = "Fresh Start will upgrade (or refresh) this computer to the GMI standard " + 
                                     "Windows 7, Office 2010, Internet Explorer 8 software. It will also assist you " + 
                                     "with understanding and installing all additional software you are licensed to " + 
                                     "use under Windows 7.\n" +
                                     "\n" +
                                     "Click Next to analyze the software on this computer";
            txtLandingContent.TextWrapping = TextWrapping.Wrap;

        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            this.NavigationService.Navigate(new System.Uri("/User_Imaging/SoftwareValidation", System.UriKind.Relative));
        }

        private void imgExpectations_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("http://spis.generalmills.com/sites/mshub/ContentLibrary/Fresh%20Expectations.wmv"), "_newWindow");
        }
    }
}
